package com.spring;

import com.kk.fatory.Person;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class Spring {
    public static void main(String[] args) {
        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("SpringConfig.xml"));
        Person person = (Person) beanFactory.getBean("japan");
        ApplicationContext context = new ClassPathXmlApplicationContext("SpringConfig.xml");
        context.getBean("japan");
        person.say();
    }
}
